import React from 'react'

import '../css/login.css'

class Login extends React.Component{
    constructor(props){
        super(props)
        this.state={}
    }
    render(){
        return(
            <div className='Login'>
                <header>
                    <div className='w head-box'>
                        <div className="logo"></div>
                    </div>
                </header>
                <div className='form'>
                    <h3><span>账号登录</span>&emsp;|&emsp;<span>扫码登录</span></h3>
                    <input type="text" placeholder='邮箱 | 手机号码 | 小米ID ' ref='user' />
                    <input type="text" placeholder='请输入密码' ref='pwd' />
                    <button onClick={()=>{
                        if(this.refs.user.value.trim()==''||this.refs.pwd.value.trim()==''){
                            return alert('不能输入空白信息')
                        }
                        let user=this.refs.user.value
                        this.props.history.push({pathname:'/index',state:{user:user}})
                    }}>登录</button>
                </div>
            </div>
        )
    }

}

export default Login;